package com.example.redis.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;

@ControllerAdvice
public class Handler {

    @ExceptionHandler(value = Exception.class)
//    @ResponseBody
    public String exceptionHandler(Exception e, HttpServletRequest request){
        e.printStackTrace();
        System.out.println("进行统一异常处理");
//        return ResultUtil.error("都出错了你还想看到啥");
        return "404.html";
    }
}
